FROM python:3.9

# 安装系统依赖（包括 OpenCV 所需的）
RUN apt-get update && apt-get install -y \
    ffmpeg \
    libsm6 \
    libxext6 \
    libxrender-dev \
    libglib2.0-0 \
    libgl1-mesa-glx \
    && rm -rf /var/lib/apt/lists/*

# 设置工作目录
WORKDIR /app

# 复制代码
COPY . /app

ENV GOOGLE_APPLICATION_CREDENTIALS=/app/keys/google-server.json

# 安装依赖
RUN pip install --no-cache-dir -r requirements.txt

# 启动服务
CMD ["python", "-m", "uvicorn", "index:app", "--host", "0.0.0.0", "--port", "8000", "--reload"]
